import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Container from '../components/core/Container.vue'
import LoginView from '@/components/core/Login.vue'
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'login',
    component: LoginView,
  },
  {
    path: '/',
    component: Container,
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/views/HomeView.vue'),
      },
      {
        path: 'batteryinfo',
        name: 'BatteryInfo',
        component: () => import('@/views/BatteryInfoView.vue'),
      },
      {
        path: 'batteryswappingcabinetinfo',
        name: 'BatterySwappingCabinetInfo',
        component: () => import('@/views/BatterySwappingCabinetInfo.vue'),
      },
      {
        path: 'chargecabinetinfo',
        name: 'ChargeCabinetInfo',
        component: () => import('@/views/ChargeCabinetInfo.vue'),
      },
      {
        path: 'map',
        name: 'Map',
        component: () => import('@/views/MapView.vue'),
      },
    ],
  },
]
const router = createRouter({
  history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
  routes: constantRoutes,
})

export default router
